package speedball.start;

import com.jfoenix.controls.JFXSpinner;
import javafx.animation.FadeTransition;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.util.Duration;

import javax.annotation.PostConstruct;
import java.net.URL;
import java.util.ResourceBundle;

public class SpinnerController  implements Initializable {

//    @FXML
//    private MySpinner blueSpinner;
    @FXML
    private MySpinner greenSpinner;

    @PostConstruct
    public void init() {
        Timeline timeline = new Timeline(
            new KeyFrame(
//                Duration.ZERO,
                    Duration.seconds(4),
                new KeyValue(greenSpinner.progressProperty(), 0)
            ),
//            new KeyFrame(
//                Duration.seconds(0.5),
//                new KeyValue(greenSpinner.progressProperty(), 0.5)
//            ),
            new KeyFrame(
                Duration.seconds(15),
//                new KeyValue(blueSpinner.progressProperty(), 1),
                new KeyValue(greenSpinner.progressProperty(), 1)
            )
        );
//        timeline.setCycleCount(Timeline.INDEFINITE);
        timeline.setCycleCount(1);
        timeline.play();
    }


    @Override
    public void initialize(URL location, ResourceBundle resources) {











        init();
    }
}
